-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement mismatched_target_os lint #5506
Conversation
dfa13ab
to
be57434
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This looks really good. One last thing
be57434
to
da6a5d3
Compare
Oh, I was not aware of the stderr line limit. I guess I can remove some OS from the unix group as all of them are in the same slice in the end... |
I would suggest to keep tests for every OS, but split up the tests in unix and non-unix. This should meet the line limit of 200. |
- Show just one error message with multiple suggestions in case of using multiple times an OS in target family position - Only suggest #[cfg(unix)] when the OS is in the Unix family - Test all the operating systems
67da32e
to
303e7d1
Compare
Yeah, that's way better :) Thanks for this and all your other suggestions! |
@bors r+ Thanks! Great lint. |
📌 Commit 303e7d1 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
I've extended the check suggested in the issue to all the currently supported operating systems instead of limiting it to
linux
andmacos
, let me know if we want to do this.Also, I've restored the text
There are over XXX lints ...
in the README as it was matched against bycargo dev new_lint
.changelog: Added
mismatched_target_os
lint to warn when an operating system is used in target family position in a #[cfg] attributeCloses #3949